package com.hrp.hrpdao;

import com.hrp.domain.Jjfact;
import com.hrp.domain.Jxksgsmb;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Created by Administrator on 2018/8/15 0015.
 */
@Mapper
public interface JjfactDao {

    @Select(" select  * from JJ_FACT ")
    List<Jjfact> getAllJjfact();

    @Select(" select  * from JJ_FACT where jjmc=#{jjmc}")
    Jjfact getJjfactByJjzbmc(String jjmc);



    @Update("update JJ_FACT set jjgsmb=#{jjgsmb},jjgsmc=#{jjgsmc},jjgsmcHtml=#{jjgsmcHtml} where id=#{id}")
    void updateJjgsmbByJjzb(Jjfact jjfact);

    @Select(" select  * from JJ_FACT where id=#{id}")
    Jjfact getJjgsmb(Integer id);


    @Select(" select  * from JJ_FACT")
    List<Jjfact> getAllJJfact();

    @Select("  select (ISNULL(MAX(id),0)+1) id  from JJ_FACT")
    Integer getJjfactId();

    @Select(" select  * from JJ_FACT where id=#{id}")
    Jjfact getJjfactById(Integer id);

    @Insert(" insert into JJ_FACT(jjmc,jjmcpy,jjvalue,khkslb) values(#{jjmc},#{jjmcpy},#{jjvalue},#{khkslb}) ")
    void saveJjfactData(Jjfact jjfact);

    @Update(" update JJ_FACT set jjmc=#{jjmc},jjmcpy=#{jjmcpy},jjvalue=#{jjvalue},khkslb=#{khkslb} where id=#{id} ")
    void updateJjfactData(Jjfact jjfact);

}
